<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>江西省财审管理系统</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/Top.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/index2.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/style.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/easyui/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/easyui/themes/icon.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/buttons.css" />
    <link rel="stylesheet" type="text/css" href="./css/common.css" />
    <script type="text/javascript" src="${pageContext.request.contextPath}/easyui/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/easyui/datagrid-detailview.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/easyui/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/util/jquery.cookie.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/YMLib.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/init.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/index.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/crypto-js.min.js"></script>
    <script type="text/javascript">
        // todo 问题反馈
        function ProblemFeedback() {
            YMLib.UI.createWindowNew('problem', '问题反馈', "sysId.jsp",'updateName', 1280,620);
        }

        function regulationsProject() {
            YMLib.UI.createWindowNew('problem', '项目计划下达文号更变', "regulation.jsp",'updateName', 1280,620);
        }

        $(function () {
           var un = getUrlParame("un");
           var pw = getUrlParame("pw");
           console.log('un = ' + un);
           console.log("pw = " + pw);
           if (un != null && pw != null) {
               clearscSession();
           } else {
               selSes();
           }

            if($.cookie("name")==""){
                alert('未查询到您的真实姓名，请在右上角点击"修改真实姓名"录入');
            }
            selectJcsmSl();
            if (window.addEventListener) {
                window.addEventListener("beforeunload", handleBeforeUnload);
                window.addEventListener("unload", handleBeforeUnload);
            } else if (window.attachEvent) {
                window.attachEvent("beforeunload", handleBeforeUnload);
                window.attachEvent("unload", handleBeforeUnload);
            }

            getProblemSum();
        });

        // 登录账号
        function getProblemSum() {
            var param ={
                sysId:'2',
                account: $.cookie("truename")
                // account:'liug'
            };
            $.ajax({
                type : "POST",
                url : "http://36.2.11.102:7077/compat/selectOrderNum",
                data:JSON.stringify(param),
                dataType : 'json',
                contentType:'application/json',
                ansync:false,
                success : function(msg){
                    $("#span_id").text(msg.data.NUM);
                },
                error : function(){
                    YMLib.Tools.Show('服务器请求无响应！error code = 404',3000);
                }
            });
        }

        if (window.addEventListener) {
            window.addEventListener("beforeunload", handleBeforeUnload);
            window.addEventListener("unload", handleBeforeUnload);
        } else if (window.attachEvent) {
            window.attachEvent("onbeforeunload", handleBeforeUnload);
            window.attachEvent("onunload", handleBeforeUnload);
        }

        function handleBeforeUnload(event) {
            clearSession();
            return '您确定要关闭浏览器嘛？';
        }

        function selectJcsmSl(){
            $.ajax({
                type : "POST",
                url : "xtgl/selectJcsmSl.do?",
                data:"gydw="+$.cookie("unit2"),
                dataType : 'json',
                ansync:false,
                success : function(msg){
                    sliderelay(msg);
                },
                error : function(){
                    YMLib.Tools.Show('服务器请求无响应！error code = 404',3000);
                }
            });
        }

        function sliderelay(msg){
            $.messager.show({
                id:'ceshi',
                title:'提示消息',
                height:'100%',
                msg:'您有'+'<font size="4" color="red">'+msg.tj1+'</font>'+'个项目需要填写结存说明，项目类型是：'+msg.lsxmlx,
                timeout:21000,
                showType:'slide'
            });
        }

        function clearscSession() {
            $.ajax({
                type : "POST",
                url : "xtgl/clearSession.do",
                dataType : 'json',
                ansync: false,
                success : function(msg){
                    urllogin();
                },
                error : function(){
                    YMLib.Tools.Show('服务器请求无响应！error code = 404',3000);
                }
            });
        }

        function urllogin() {
            $.ajax({
                type : "POST",
                url : "xtgl/urllogin.do",
                dataType : 'json',
                async:false,
                data :"master.truename="+getUrlParame("un")+"&master.password="+getUrlParame("pw"),
                success : function(msg){
                    if(msg){
                        $.cookie("truename",msg.TRUENAME, {expires: 1});//将用户名放入cookie中
                        if(msg.NAME!=null)
                            $.cookie("name",msg.NAME, {expires: 1});//将用户名放入cookie中
                        else
                            $.cookie("name","", {expires: 1});//将用户名放入cookie中
                        $.cookie("unit",msg.UNIT, {expires: 1});
                        var unit2=msg.UNIT;
                        if(unit2.substr(unit2.length-2,unit2.length)=="00") unit2=unit2.substr(0,unit2.length-2);
                        if(unit2.substr(unit2.length-2,unit2.length)=="00") unit2=unit2.substr(0,unit2.length-2);
                        if(msg.UNIT=="36") $.cookie("unit2","_____36", {expires: 1});
                        else $.cookie("unit2",unit2, {expires: 1});

                        if(msg.UNIT=="36") $.cookie("dist","360000", {expires: 1});
                        else $.cookie("dist",msg.UNIT.substr(msg.UNIT.length-6,msg.UNIT.length), {expires: 1});

                        var dist2=msg.UNIT.substr(msg.UNIT.length-6,msg.UNIT.length);
                        if(dist2.substr(dist2.length-2,dist2.length)=="00") dist2=dist2.substr(0,dist2.length-2);
                        if(dist2.substr(dist2.length-2,dist2.length)=="00") dist2=dist2.substr(0,dist2.length-2);
                        $.cookie("dist2",dist2, {expires: 1});
                        $.cookie("zgx",msg.ZGX, {expires: 1});
                        $.cookie("roleid",msg.ROLEID, {expires: 1});
                        selQxByUser1(msg.ROLEID);
                        // getFwparam("1");
                    }
                    else{
                        alert("用户名或密码不正确！！");
                        clearSession();
                    }
                },
                error : function(){
                    YMLib.Tools.Show('服务器请求无响应！error code = 404',3000);
                }
            });
        }

        function getFwparam(lx){
            if($.cookie("cgdl")=="true"){
                $.cookie("cgdl","false", {expires: 1});
                lx="1";
            }else{
                if(lx=="1")
                    lx="2";
            }
        }
    </script>
</head>
<body id="index_layout" class="easyui-layout">
    <div data-options="region:'north',border:false" style="height: 98px;">
        <div class="header">
            <div class="header_content">
                <div style="position:absolute;top:15px;right:400px;color:#f2f8fe;font-family:arial;line-height:1.5em;">欢迎您：<span id="index_user"></span></div>
                <div class="system">
                    <!-- </a><em style="color:#d3fcff">|</em> -->
                    <a onclick="editNotice()" href="javascript:void(0)" style="color:#d3fcff"><i class="fa fa-bell-o" aria-hidden="true"></i></a>
<%--                    <div class="icon-with-badge">--%>
<%--                        <img class="icon_lingdang" src="images/Button/lingdang.png"/>--%>
<%--&lt;%&ndash;                        <span class="badge" id="badge">9</span>&ndash;%&gt;--%>
<%--                    </div>--%>
<%--                    <div class="icon-with-body">--%>
                        <img onclick="regulationsProject()" class="icon_lingdang" src="images/Button/lingdang.png" alt="请查看项目计划下达文号变更情况" title="请查看项目计划下达文号变更情况"/>
                        <em style="color:#d3fcff">|</em>
                    <a onclick="ProblemFeedback()" href="javascript:void(0)" style="color:#d3fcff">问题反馈（<span id="span_id" style="font-weight: normal; font-size: 14px;">0</span>）</a><em style="color:#d3fcff">|</em>
                        <a onclick="editname()" href="javascript:void(0)" style="color:#d3fcff">修改真实姓名</a><em style="color:#d3fcff">|</em>
                        <a onclick="edit()" href="javascript:void(0)" style="color:#d3fcff">修改密码</a><em style="color:#d3fcff">|</em>
                        <a onclick="clearSession()" href="javascript:void(0)" style="color:#d3fcff">退出系统</a>
<%--                    </div>--%>
                </div>
                <ul class="nav">
                    <li id="menu_010101" style="display:none;"><a id="Menu_1" href="javascript:void(0)">电子地图</a></li>
                    <li id="menu_010102" style="display:none;"><a id="Menu_2" href="javascript:void(0)">计划查询</a></li>
                    <li id="menu_010103" style="display:none;"><a id="Menu_3" href="javascript:void(0)">资金到位</a></li>
                    <li id="menu_010104" style="display:none;"><a id="Menu_4" href="javascript:void(0)">资金拨付</a></li>
                    <li id="menu_010108" style="display:none;"><a id="Menu_8" href="javascript:void(0)">资金调剂</a></li>
                   <%-- <li id="menu_010105" style="display:none;"><a id="Menu_5" href="javascript:void(0)">资产管理</a></li>--%>
                    <li id="menu_010106" style="display:none;"><a id="Menu_6" href="javascript:void(0)">统计报表</a></li>
                    <li id="menu_010107" style="display:none;"><a id="Menu_7" href="javascript:void(0)">系统管理</a></li>
                </ul>
            </div>
        </div>
    </div>
    <div data-options="region:'center',border:'false'" style="margin: 0px; padding: 0px;overflow: hidden">
        <div id="c1" style="width:100%;height:100%;">
            <iframe id="c1f" name="c1f"  src="" frameborder='0' height='100%' width='100%'></iframe>
        </div>
        <div id="c2" style="width:100%;height:100%;display:none">
            <iframe id="c2f" name="c2f"  src="" frameborder='0' height='100%' width='100%'></iframe>
        </div>
        <div id="c3" style="width:100%;height:100%;display:none">
            <iframe id="c3f" name="c3f"src="" frameborder='0' height='100%' width='100%'></iframe>
        </div>
        <div id="c8" style="width:100%;height:100%;display:none">
            <iframe id="c8f" name="c8f"src="" frameborder='0' height='100%' width='100%'></iframe>
        </div>
        <div id="c4" style="width:100%;height:100%;display:none">
            <iframe id="c4f" name="c4f" src="" frameborder='0' height='100%' width='100%'></iframe>
        </div>
        <div id="c5" style="width:100%;height:100%;display:none">
            <iframe id="c5f" name="c5f"src="" frameborder='0' height='100%' width='100%'></iframe>
        </div>
        <div id="c6" style="width:100%;height:100%;display:none">
            <iframe id="c6f" name="c6f"src="" frameborder='0' height='100%' width='100%'></iframe>
        </div>
        <div id="c7" style="width:100%;height:100%;display:none">
            <iframe id="c7f" name="c7f"src="" frameborder='0' height='100%' width='100%'></iframe>
        </div>
    </div>
    <div data-options="region:'south',border:false,split:false" style="height: 25px;color:#FFF;line-height: 25px; background: url(image/footerbg.gif) 0 0 repeat-x; text-align: center;overflow: hidden;">
        <p>监制单位：江西省综合交通运输事业发展中心 &nbsp;&nbsp;&nbsp;&nbsp; 技术支持：北京恒达时讯科技股份有限公司 &nbsp;&nbsp;&nbsp;&nbsp; 运维QQ群：414440183</p>
    </div>
</body>
</html>
